﻿using System.Collections.Generic;
using System.Web.UI.WebControls;
using System;
using Trirand.Web.Mvc;

namespace OneDollarStore.Areas.Admin.Models
{
    public class DesktopJqGridModel
    {
        public JQGrid DesktopGrid { get; set; }

        public DesktopJqGridModel()
        {
            DesktopGrid = new JQGrid
            {
                Columns = new List<JQGridColumn>()
                {
                    new JQGridColumn
                    {
                        DataField = "DesktopID",
                        HeaderText="ID",
                        Width = 50,
                        Editable = false,
                        Searchable = false,
                        PrimaryKey = true
                    },
                    new JQGridColumn
                    {
                        DataField = "Name",
                        Width = 130,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "Description",
                        Width = 80,
                        Editable = true,
                        EditType = EditType.TextArea,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "Warranty",
                        Width = 70,
                        Editable = true,
                        DataType = typeof(double)
                    },
                    new JQGridColumn
                    {
                        DataField = "DealerPrice",
                        Width = 90,
                        Editable = true,
                        DataType = typeof(decimal)
                    },
                    new JQGridColumn
                    {
                        DataField = "RetailPrice",
                        Width = 90,
                        Editable = true,
                        DataType = typeof(decimal)
                    },
                    new JQGridColumn
                    {
                        DataField = "PromotionPrice",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(decimal)
                    },
                    new JQGridColumn
                    {
                        DataField = "PromotionStartDate",
                        Width = 130,
                        Editable = true,
                        DataType = typeof(DateTime)
                    },
                    new JQGridColumn
                    {
                        DataField = "PromotionEndDate",
                        Width = 130,
                        Editable = true,
                        DataType = typeof(DateTime)
                    },
                    new JQGridColumn
                    {
                        DataField = "Quantity",
                        Width = 80,
                        Editable = true,
                        DataType = typeof(int)
                    },
                    new JQGridColumn
                    {
                        DataField = "Highlight",
                        Width = 90,
                        Editable = true,
                        EditType = EditType.CheckBox,
                        DataType = typeof(bool)
                    },
                    new JQGridColumn
                    {
                        DataField = "Category",
                        Width = 70,
                        Editable = true,
                        EditType = EditType.DropDown,
                        DataType = typeof(int)
                    },
                    new JQGridColumn
                    {
                        DataField = "Manufacturer",
                        Width = 100,
                        Editable = true,
                        EditType = EditType.DropDown,
                        DataType = typeof(int)
                    },
                    new JQGridColumn
                    {
                        DataField = "Mainboard",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "CPU",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "RAM",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "HDD",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "VGA",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "CDDVD",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "Network",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "OperatingSystem",
                        Width = 100,
                        Editable = true,
                        DataType = typeof(string)
                    },
                    new JQGridColumn
                    {
                        DataField = "Image",
                        Width = 90,
                        Editable = true,
                        Searchable = false
                    },
                },
                Width = Unit.Pixel(1060),
                Height = Unit.Pixel(530)
            };
            DesktopGrid.ToolBarSettings.ShowRefreshButton = true;
            DesktopGrid.AppearanceSettings.ScrollBarOffset = -2500;
        }
    }
}